import request from './request'

/**
 * 获取标签列表
 * @param {*} params
 * @returns
 */
export const getTagList = (params) => {
  return request({
    url: '/tag/list',
    params
  })
}

/**
 * 新增标签
 * @param {*} data
 * @returns
 */
export const addTag = (data) => {
  return request({
    url: '/tag/add',
    method: 'post',
    data
  })
}

/**
 * 修改标签
 * @param {*} data
 * @returns
 */
export const updateTag = (data) => {
  return request({
    url: '/tag/update',
    method: 'put',
    data
  })
}

/**
 * 根据Id删除标签
 * @param {*} id
 */
export const deleteTag = (id) => {
  return request({
    url: `/tag/${id}`,
    method: 'delete'
  })
}

/**
 * 根据分类Id获取标签列表
 * @param {*} params
 * @returns
 */
export const getTagLsitBySortId = (params) => {
  return request({
    url: '/tag/list/sortid',
    params
  })
}
